1. Field of the Invention
The invention relates to a method and apparatus of coding digital image data and more specifically to a method and apparatus of coding consecutive blocks of data groups having as content the values of pixels of an image.
2. Discussion of Related Art
Digital image data forms the digital representation of a physical image and is e.g. generated by electro-optically scanning an image according to an orthogonal raster of rows and columns of pixels and converting the measured optical density of each pixel into a digital value that may have one of two possible values (black or white) or one of several possible values (shades of gray). Normally, the digital data takes the form of groups of bits or bytes and are stored in a memory in blocks. One such block may correspond to one row or line of pixels of the image.
A method of the kind described above is known from IBM Technical Disclosure Bulletin, Vol. 31, No. 5 (October 1988). In accordance with this known method a series of data groups (a data group being a byte with the gray value of a pixel) having an identical value within a line are coded with a code which contains (a) the number of data groups in the series and (b) the content of those data groups. This coding is generally termed "run length coding". Run length coding is also frequently applied to data groups containing binary pixel values, as is apparent, for example, from U.S. Pat. No. 4,748,512.
If, as in a page of text, the rows of pixels contain many series of identical value, this coding can result in a considerable compression of the image data, and this is an attractive feature in connection with the storage thereof in a memory or with its transmission, for example, over a network. However, there are many series of pixels with identical value in the column direction as well, and they can be used for a more extensive coding, which results in even greater compression of the image data.
Although U.S. Pat. No. 4,748,512 also makes use of a vertical repetition code, it does so only to a very restricted degree, namely by replacing a pixel row completely identical to the preceding one by a repetition code. This is a relatively ineffective coding method, since there is relatively little chance that two consecutive rows will be completely identical.
When a uniform gray surface in an image is detected by a scanner, there will still be small variations in the measured pixel values due to noise and deviations in the scanner. These small variations restrict the codability if complete equality of the corresponding data groups is required. It has been found, however, that minor variations in gray values frequently do not visibly change the total picture, and consequently the choice has been made to make a series of consecutive data groups codable in the case of gray value pixels with minor adjustments of the pixel values. The method according to the invention, therefore, provides for equality "by approximation" and not absolute equality. As a result, in practice the coding results in a much higher compression.
It should also be noted that the approximation of a series of pixel values by a linear function is known per se and is described, for example, in IBM Technical Disclosure Bulletin, Vol. 30, No. 12 (May 1988). However, the use of the pixel values in the preceding line to increase the efficiency of the coding cannot be derived therefrom.